package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.CarDao;
import entity.CarInfo;

public class SearchCarServlet extends HttpServlet {
	protected void service(HttpServletRequest request,HttpServletResponse response)
			throws IOException,ServletException{
		String searchValue = request.getParameter("searchValue");
		List<CarInfo> cars = new CarDao().query(searchValue);
		request.setAttribute("cars", cars);
		request.getRequestDispatcher("searchCar.jsp").forward(request, response);
		
	}

}
